﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NPipeline.Stage
{
    public class ConsoleOutStage : BaseStage, IStage
    {
        public string STAGE_NAME { get; set; }

        #region IStage Members

        public ConsoleOutStage()
        {
            STAGE_NAME = "NONAME";
        }

        public ConsoleOutStage(string id)
        {
            STAGE_NAME = id;
        }


        public override void Init(IStageContext context) 
        {
            base.Init(context);
            Console.WriteLine("{0}:In init stage", STAGE_NAME);
        }

        public override void PreProcess()
        {
            Console.WriteLine("{0}: In preprocess stage", STAGE_NAME);
        }

        public override void Process(object obj)
        {
            Console.WriteLine("{0}: Process Stage for object: {1}", STAGE_NAME, obj.ToString());
            this.Emit(obj);
        }

        public override void PostProcess()
        {
            Console.WriteLine("{0}: In postprocess stage", STAGE_NAME);
        }

        public override void Release()
        {
            Console.WriteLine("{0}: In release stage", STAGE_NAME);
        }

        #endregion



    }
}
